


 *TABLE 1  - UGANDA
 ***********************************	   
	   
 use "$FA_datasets/data_TFP_UGA.dta", clear

 *GU estimates
 *COLUMN 2sls In TABL A.2. 
 
 global time="year season"
 
 *Column 1
global alphal  = 0.69
global alphax  = 0.22
global lnTFP =  "lnTFPA_2sls" 


global aggregation = "year season"
	CalculateEfficiency  
global aggregation = "year season region"
	CalculateEfficiency 
global aggregation = "year season region parish_code"
	CalculateEfficiency  
 	
 *Column 2	
global alphal  = 0.69
global alphax  = 0.22
global lnTFP =  "lnTFPB_2sls" 

global aggregation = "year season"
	CalculateEfficiency  
global aggregation = "year season region"
	CalculateEfficiency 
global aggregation = "year season region parish_code"
	CalculateEfficiency  

*Column 3
	
 global alphal  = 0.69
global alphax  = 0.22
global lnTFP =  "lnTFPA_2sls" 

global aggregation = "year season"
	CalculateEfficiencyHH
global aggregation = "year season region"
	CalculateEfficiencyHH
global aggregation = "year season region parish_code"
	CalculateEfficiencyHH


*Column 4

global alphal  = 0.4
global alphax  = 0.3
cap drop ln_resid
gen ln_resid= y-($alphal * l) - ($alphax * x)
global lnTFP =  "ln_resid" 

 global aggregation = "year season"
	CalculateEfficiency  
global aggregation = "year season region"
	CalculateEfficiency 
global aggregation = "year season region parish_code"
	CalculateEfficiency  


*COlumn 5
global alphal  = 0.4
global alphax  = 0.3
cap drop ln_resid
gen ln_resid= y-($alphal * l) - ($alphax * x)
global lnTFP =  "ln_resid" 

global aggregation = "year season"
	CalculateEfficiencyHH  
global aggregation = "year season region"
	CalculateEfficiencyHH 
global aggregation = "year season region parish_code"
	CalculateEfficiencyHH  
	
		
		
		
		
		
		
	*TANZANIA
	
   use "$FA_datasets/data_TFP_TZ.dta", clear
    *use IVCRC esatimts, since 2sls are too close to CRS, 0.73 and 0.28
	* COLUMN IVCRC IN Table A1
	*use TFPA since I cannot replicate ICRC estimates. 
  global time="year season"
  
  *Column 1
global alphal  = 0.61
global alphax  = 0.26
global lnTFP =  "lnTFPA" 


global aggregation = "year season"
	CalculateEfficiency  
global aggregation = "year season region"
	CalculateEfficiency 
global aggregation = "year season region parish_code"
	CalculateEfficiency  
 	
 *Column 2	
global alphal  = 0.61
global alphax  = 0.26
global lnTFP =  "lnTFPB" 

global aggregation = "year season"
	CalculateEfficiency  
global aggregation = "year season region"
	CalculateEfficiency 
global aggregation = "year season region parish_code"
	CalculateEfficiency  

*Column 3
	
global alphal  = 0.61
global alphax  = 0.26
global lnTFP =  "lnTFPA" 

global aggregation = "year season"
	CalculateEfficiencyHH  
global aggregation = "year season region"
	CalculateEfficiencyHH 
global aggregation = "year season region parish_code"
	CalculateEfficiencyHH  


*Column 4

global alphal  = 0.4
global alphax  = 0.3
cap drop ln_resid
gen ln_resid= y-($alphal * l) - ($alphax * x)
global lnTFP =  "ln_resid" 

 global aggregation = "year season"
	CalculateEfficiency  
global aggregation = "year season region"
	CalculateEfficiency 
global aggregation = "year season region parish_code"
	CalculateEfficiency  


*COlumn 5
global alphal  = 0.4
global alphax  = 0.3
cap drop ln_resid
gen ln_resid= y-($alphal * l) - ($alphax * x)
global lnTFP =  "ln_resid" 

global aggregation = "year season"
	CalculateEfficiencyHH  
global aggregation = "year season region"
	CalculateEfficiencyHH 
global aggregation = "year season region parish_code"
	CalculateEfficiencyHH  
	
		
 